package com.msb;

import java.awt.*;

/// 爆炸
public class Explode {

    public static int WIDTH = ResourceMgr.explodes[0].getWidth();
    public static int HEIGHT = ResourceMgr.explodes[0].getHeight();

    private int x, y;
    private GameFrame frame;

    private int indext = 0;

    public Explode(int x, int y, GameFrame frame) {
        this.x = x;
        this.y = y;
        this.frame = frame;
    }

    // 画爆炸
    public void paint(Graphics g) {
        g.drawImage(ResourceMgr.explodes[indext++], x, y, null);
        if (indext >= ResourceMgr.explodes.length) {
            frame.explodes.remove(this);
        }
    }
}
